package com.example.demo.common;
import java.util.HashMap;
import java.util.Map;
/**
 * 操作业务工具类
 */
public class ResultModelTool {
    public static ResultModel handleResultModel(ResultModel resultModel) {
        ResultModel handledModel = new ResultModel();
        Map map = new HashMap();
        if (resultModel != null) {
            int error = resultModel.getCode();
            handledModel.setCode(error);
            switch (error) {
                case 100:
                    handledModel.setData(map);
                    break;
                case 10001:
                    handledModel.setData(map);
                    break;

                case 10003:
                    handledModel.setData(resultModel.getData());
                    break;

                case 10005:

                    handledModel.setData(map);
                    break;


                default:
                    handledModel.setData(resultModel.getData());
                    break;
            }
        }
        return handledModel;
    }
}
